// src/router/index.ts
import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import Favor from '../views/Favor.vue'
import Activity from '../views/Activity.vue'
import Message from '../views/Message.vue'
import Personal from '../views/Personal.vue'
import Chef from '../views/Chef.vue'
import Publish from '../views/Publish.vue'
import PersonalSetting from '@/views/PersonalSetting.vue'
import Points from '@/views/Points.vue'
import Checkins  from '@/views/Checkins.vue'
import Login from '@/views/Login.vue'
const routes = [
  // 首页 - 分类页（对应顶部“分类”标签）
  {
    path: '/home',
    name: 'Home',
    component: Home,
    meta: { title: '首页' }
  },
  // 收藏页
  {
    path: '/favor',
    name: 'Favor',
    component: Favor,
    meta: { title: '收藏' }
  },
  // 订单页
  {
    path: '/activity',
    name: 'Activity',
    component: Activity,
    meta: { title: '活动' }
  },
  // 消息页
  {
    path: '/message',
    name: 'Message',
    component: Message,
    meta: { title: '消息' }
  },
  // 我的个人中心
  {
    path: '/personal',
    name: 'Personal',
    component: Personal,
    meta: { title: '我的' }
  },
  {
    path: '/personalSetting',
    name: 'PersonalSetting',
    component: PersonalSetting,
    meta: { title: '设置个人资料' }
  },
  {
    path: '/points',
    name: 'Points',
    component: Points,
    meta: { title: '积分' }
  },
  {
    path: '/checkins',
    name: 'Checkins',
    component: Checkins,
    meta: { title: '签到' }
  },
  // 名厨菜谱
  {
    path: '/chef',
    name: 'Chef',
    component: Chef,
    meta: { title: '名厨菜' }
  },
  // 首页
  {
    path: '/home',
    name: 'Home',
    component: Home,
    meta: { title: '记账' }
  },
  // 发布新菜谱
  {
    path: '/publish',
    name: 'Publish',
    component: Publish,
    meta: { title: '发布' }
  },
  // 默认路由
  // 默认路由
  {
    path: '/',
    redirect: '/home'
  },{
    path: '/login',
    name: 'login',
    component: Login,
    meta: { hideNavbar: true, title: '登录' }
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
